package org.dlsu.mt.parser.TRANSFER;

import java.util.Vector;

import org.dlsu.mt.parser.FStructure;

public class TransferOutput
{
	FStructure f;
	Vector<FStructure> unassociated;
	int counter;
	
	public TransferOutput(FStructure f)
	{
		this.f = f;
		unassociated = new Vector();
		counter=0;
	}
	
	public TransferOutput(FStructure f, Vector<FStructure> unassociated)
	{
		this.f = f;
		this.unassociated = unassociated;
		counter=0;
	}
	
	public FStructure getFStructure()
	{
		return f;
	}
	
	public void initUnassociatedIterator()
	{
		counter=0;
	}
	
	public FStructure nextUnassociated()
	{
		if(counter<unassociated.size())
		{
			FStructure temp = unassociated.get(counter);
			counter++;
			return temp;
		}
		return null;
	}
	
	public boolean hasMoreUnassociated()
	{
		if(counter<=unassociated.size())
			return true;
		else
			return false;
	}
	
	public void addUnassociated(String structName, Vector<FStructure> list)
	{
		for(int i=0;i<list.size();i++)
		{
			FStructure fstruct = new FStructure(structName);
			fstruct.addEntry(list.get(i));
			unassociated.add(fstruct);
		}
	}
}